/*
 * Copyright (c) 2005, 2014 vacoor
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.vacoor.nothing.shop.entity;

/**
 * @author vacoor
 */
public abstract class SortEntity extends BaseEntity implements Comparable<SortEntity> {
    protected Integer sort;

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    @Override
    public int compareTo(SortEntity sortEntity) {
        if (null == sortEntity || null == sortEntity.sort) {
            return 1;
        }

        return this.sort.compareTo(sortEntity.sort);
    }
}
